<template>
  <div>
      <el-form :model="add">
        <el-form-item label="">套餐名称：
            <el-input v-model="add.setMealName" placeholder="请输入内容 " style="width: 500px"></el-input>
        </el-form-item>
        <el-form-item label="">套餐图片：
            <el-input v-model="add.img" placeholder="请输入内容" style="width: 500px"></el-input>
        </el-form-item>
        <el-form-item label="">套餐类型：
             <el-select v-model="add.pkName" placeholder="请输入内容" style="width: 500px" >
                    <el-option
                    v-for="item in options"
                    :key="item.id"
                    :label="item.pkName"
                    :value="item.pkName">
                    </el-option>
                </el-select>
        </el-form-item>
        <el-form-item label="">所属院区：
            <el-select v-model="add.campusName" placeholder="请输入内容" style="width: 500px" >
                    <el-option
                    v-for="item in options"
                    :key="item.id"
                    :label="item.campusName"
                    :value="item.campusName">
                    </el-option>
                </el-select>
        </el-form-item>
        <el-form-item label="">套餐项目：
            <el-select v-model="add.pkMenu" placeholder="请输入内容" style="width: 500px" >
                    <el-option
                    v-for="item in options"
                    :key="item.id"
                    :label="item.pkMenu"
                    :value="item.pkMenu">
                    </el-option>
                </el-select>
        </el-form-item>
        <el-form-item label="">套餐价格：
            <el-input v-model="add.project" placeholder="请输入内容" style="width: 500px"></el-input>
        </el-form-item>
        <el-form-item label="">套餐介绍：
            <el-input v-model="add.price" placeholder="请输入内容" style="width: 500px"></el-input>
        </el-form-item>
        <el-button type="primary" @click="MealAdd()">确定</el-button>
        <el-button type="primary" @click="quxiao()">取消</el-button>
      </el-form>
  </div>
</template>

<script>
export default {
    created(){
        this.option();
    },
    data(){
        return{
            add:{},
            options:[],
        }
    },
    methods:{
        option(){
            this.$axios.get("/user/user/doctor/ren/finMealAll").then(res=>{
                this.options=res.data.data.list
            })
        },
        MealAdd(){
            console.log(this.add)
            this.$axios.post("/user/user/doctor/ren/MealAdd",this.add).then(res=>{
                this.add={};
                this.$router.push({path:'/taocan' })
            })
        },
          quxiao(){
            this.$router.push({path:'/taocan' })
        }
    }
}
</script>

<style>

</style>